<!DOCTYPE html>
<html lang="en">
<head>
<title><{$knows_data.section.subject}></title>
<include file="Public:header" />
</head>
<body>
<header> <a href="javascript:void(0)" class="lft back"><i class="icon icon-back"></i><i>返回</i></a>
  <h5><{$knows_data.section.subject}></h5>
</header>
<section>
  <div class="vd" id="videoPlayer_div">
    <div id="videoPlayer" style="width:100%"></div>
    <img id="videoPlayer_img" src="<{$knows_data.video_info.thumbnail}>" alt=""> 
	<a href="javascript:void(0)" class="btn-shiting" url="<{$knows_data.video_info.m3u8_240}>" onClick="open_video(this)"></a> 
	</div>
  <style>
  #videoPlayer{ width:100%; }
.tab a li{ width:25%}
.none{ display:none}
</style>
  <ul class="tab" id="content_tab">
    <a href="#section"> <li class="on"
    >目录
    </li>
    </a> <a href="#notes"> <li 
    >笔记
    </li>
    </a> <a href="#ask"> <li 
    >答疑
    </li>
    </a> <a href="#exercise"> <li 
    >练习
    </li>
    </a>
  </ul>
  <div class="clear"></div>
    <div id="section" class="tab_content">
   <{:Widget("BoxEdu","Index")->subject_section($subjectid)}>
   </div>
    <div id="notes" class="tab_content none">
   <{:Widget("BoxEdu","Index")->subject_notes($knowsid,$user_id)}>
   </div>
    <div id="exercise" class="tab_content none">
   <{:Widget("BoxEdu","Index")->subject_exercise($examid)}>
   </div>
   <div id="ask" class="tab_content none">
   <{:Widget("BoxEdu","Index")->ask_list("knowsid=$knowsid")}>
   </div>
  <!--显示提问按钮-->
 <div id="ask_box_btn" class="btn_s none">
    <div style="height:40px;"></div>
    <div class="mt15 box-btn boot-fixed"><a href="<{:U('Ask/add',array('knowsid'=>$knowsid))}>" class="btn btn-blk">提问</a></div>
</div>
  <!--显示提问按钮-->
</section>
<script type="text/javascript" charset="utf-8" src="http://cdn.aodianyun.com/lss/ckplayer/player.js"></script>
<script>
$(function(){
	$("#content_tab a").click(function(){
		var id=$(this).attr("href");
		$(this).parent().find("li").removeClass("on");
		$(this).find("li").addClass("on");
		$(".tab_content").hide();
		$(id).show();
		$(".btn_s").hide();
		if($(id+"_box_btn").length>0){
			$(id+"_box_btn").show();
		}
		if(id=="#exercise"){
			$("#videoPlayer_div").slideToggle(300);
		}else{
			$("#videoPlayer_div").show();
		}
	})
})

function open_video(obj){
	var w =$(obj).prev().width();
	var h =$(obj).prev().height();
	w=w?w:"100%";
	h=h?h:"181";
	var url=$(obj).attr("url");//视频地址
	var image=$(obj).prev().attr("src");//封面图片
	$(obj).prev().hide();
	$(obj).hide();
	var flashvars={f:'http://cdn.aodianyun.com/lss/ckplayer/m3u8.swf',a:url,c:0,s:4,i:image,lv:0,p:1};
	var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent',autostart: true};
	var video=[url];
	CKobject.embed('http://cdn.aodianyun.com/lss/ckplayer/ckplayer.swf','videoPlayer','ckplayerFlashBox',w,h,false,flashvars,video,params);
	CKobject.startPlay(); 
	var knowsid="<{$knowsid}>";
	var subjectid="<{$subjectid}>";
	$.get("/BoxApi/BoxEdu/Subject/open_video",{knowsid:knowsid,subjectid:subjectid});
}



</script>
<!-- <include file="Public:footer" />-->
</body>
</html>
